package com.goldgov.SmsSend.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.goldgov.SmsSend.service.IMasSendSmsService;
import com.goldgov.kcloud.core.json.JsonObject;
import com.goldgov.utils.JsonUtil;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@RestController
@RequestMapping("/portal/masSmsSend")
@Api("短信发送接口")
public class MasSmsSendManagerController {
protected final Log logger = LogFactory.getLog(this.getClass());
@Autowired
private IMasSendSmsService masSendSmsService;
	@GetMapping("/sendSms")
	@ApiOperation(value = "极光推送", notes ="")
	public JsonObject<Object> sendSms(@ApiParam(value = "手机号") @RequestParam("phonenumber") String phonenumber,
			@ApiParam(value = "短信内容") @RequestParam("sendMessage") String sendMessage,HttpServletRequest request){
		boolean result=masSendSmsService.sendSms(phonenumber, sendMessage);
		if(result) {
			return JsonUtil.success();	
		}
		return JsonUtil.error();
	}
}
